<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>边框旋转线条特效</title>
    <style>
      .item {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 200px;
      }

      .item div {
        width: 200px;
        height: 200px;
        line-height: 200px;
        position: relative;
        text-align: center;
        font-size: 24px;
      }

      .item div::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        /* border: 2px solid rgb(17, 36, 100); */
        border: 2px solid #a2a781;
        transition: all 0.5s;
        animation: clippath 3s infinite linear;
      }

      @keyframes clippath {
        0%,
        100% {
          /* 裁剪指定区域，insert 不规则图形，（上右下左） */
          clip-path: inset(0 0 99% 0);
        }
        25% {
          clip-path: inset(0 99% 0 0);
        }
        50% {
          clip-path: inset(99% 0 0 0);
        }
        75% {
          clip-path: inset(0 0 0 99%);
        }
      }
    </style>
  </head>
  <body>
    <div class="item" info="转动的边框线(单条)">
      <div>hello world</div>
    </div>
  </body>
</html>
